<?php
class ux_t3lib_formmail extends t3lib_formmail {

	function start($V,$base64=false)	{      
	
		if (t3lib_div::int_from_ver(TYPO3_version) >= 4005000) {
			$this->mailMessage = t3lib_div::makeInstance('t3lib_mail_Message');
			
			if(isset($V['NOSENDMAIL'])) {
				if($V['check']=='ok') {
					unset($V['check']);
					unset($V['NOSENDMAIL']);
					unset($V['locationData']);
					unset($V['formtype_mail']);
					unset($V['accessibleMailForm']);
					parent::start($V,$base64);
					$this->sendTheMail();
				}
			} else {
				 parent::start($V,$base64);
				 $this->sendTheMail();
			}
		}
		else {
			if(isset($V['NOSENDMAIL'])) {
				if($V['check']=='ok') {
					unset($V['check']);
					unset($V['NOSENDMAIL']);
					unset($V['locationData']);
					unset($V['formtype_mail']);
					unset($V['accessibleMailForm']);
					parent::start($V,$base64);
					$this->send($V['recipient']);
				}
			} else {
				 parent::start($V,$base64);
				 $this->send($V['recipient']);
			}
		}
	}
}
?>
